<template>
  <div>
    <ul>
      <li v-for="(item, index) in list" :key="index">
        {{ item }} <button @click="Delete(index)">删除</button>
      </li>
    </ul>
    <button @click="fn">生成</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
    }
  },
  methods: {
    Delete(index) {
      this.list.splice(index, 1)
    },
    fn() {
      this.list.push(Math.floor(Math.random() * 99 + 1))
    },
  },
}
</script>

<style></style>
